﻿CREATE proc [dbo].[danhmucHoaDon_Them]  
@so_hdon varchar(255),  
@so_seri nvarchar(255),  
@masothue nvarchar(255)  
as  
if  exists(select * from DM_HoaDon   Where so_hdon=@so_hdon  or so_seri=@so_seri   )  
begin  

select ErrCode=0
end  
else  
begin  
insert into DM_HoaDon (so_hdon,so_seri,masothue )  
    values(@so_hdon,@so_seri,@masothue)   
select ErrCode=1  
end